package com.niiwoo.civet.user.enums;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author: wuke
 * @Description: 学历匹配枚举
 * @Date: Created in 15:19 2017/12/29
 */
@Getter
@AllArgsConstructor
public enum EducationMatchEnum {
    DOCTOR("博士",UserPersonalEnum.UserEduLevelEnum.DOCTOR),
    MASTER("硕士",UserPersonalEnum.UserEduLevelEnum.MASTER),
    GRADUATE_STUDENT("研究生",UserPersonalEnum.UserEduLevelEnum.MASTER),
    POSTGRADUATE_CLASS("研究生班",UserPersonalEnum.UserEduLevelEnum.MASTER),
    UNDERGRADUATE("本科",UserPersonalEnum.UserEduLevelEnum.UNDERGRADUATE),
    SECOND_UNDERGRADUATE("第二本科",UserPersonalEnum.UserEduLevelEnum.UNDERGRADUATE),
    SECOND_BACHELOR_DEGREE("第二学士学位",UserPersonalEnum.UserEduLevelEnum.JUNIOR_COLLEGE),
    SPECIALTY("专科",UserPersonalEnum.UserEduLevelEnum.JUNIOR_COLLEGE),
    SPECIAL_PROMOTION("专升本",UserPersonalEnum.UserEduLevelEnum.JUNIOR_COLLEGE),
    EVENING_UNIVERSITY_ORDINARY_UNIVERSITY("夜大电大函大普通班",UserPersonalEnum.UserEduLevelEnum.JUNIOR_COLLEGE),
    SECONDARY_PROFESSIONAL_OR_MIDDLE("中等专业学校或中等技术学校",UserPersonalEnum.UserEduLevelEnum.SPECIAL_SCHOOL),
    TECHNICAL_SCHOOL("技工学校",UserPersonalEnum.UserEduLevelEnum.SPECIAL_SCHOOL),
    HIGH_SCHOOL("高中",UserPersonalEnum.UserEduLevelEnum.SPECIAL_SCHOOL),
    JUNIOR_MIDDLE_SCHOOL("初中",UserPersonalEnum.UserEduLevelEnum.SPECIAL_SCHOOL),
    PRIMARY_SCHOOL("小学",UserPersonalEnum.UserEduLevelEnum.SPECIAL_SCHOOL),
    ILLITERACY("文盲或半文盲",UserPersonalEnum.UserEduLevelEnum.SPECIAL_SCHOOL);

    //考拉学历名称
    private String kaolaEducation;
    //你我金融APP学历枚举
    private UserPersonalEnum.UserEduLevelEnum userEduLevelEnum;

    public static EducationMatchEnum enumOf(String kaolaEducation) {
        for (EducationMatchEnum educationMatchEnum : values()) {
            if (educationMatchEnum.getKaolaEducation().equals(kaolaEducation)) {
                return educationMatchEnum;
            }
        }
        throw new NoSuchEnumValueException("未找到对应EducationMatchEnum枚举，type：" + kaolaEducation);
    }
}
